﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace CRS.Web.BaseData
{
    public partial class SaleInfo : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Response.Expires = -1;
            if (!IsPostBack)
            {
                GridView1.DataSource = BindList();
                GridView1.DataBind();
            }
        }

        public DataTable BindList()
        {
            var result = new DataTable();
            result.Columns.Add("货品条码", typeof(string)); //产品名称
            result.Columns.Add("货品名称", typeof(string)); //单位
            result.Columns.Add("类型", typeof(string)); //单价
            result.Columns.Add("价格", typeof(string)); //数量
            result.Columns.Add("数量", typeof(string)); //单价
            result.Columns.Add("金额", typeof(string)); //数量
            result.Columns.Add("免费", typeof(bool)); //单价

            //给该列填值
            DataRow dr = result.NewRow();
            dr["货品条码"] = "000001";
            dr["货品名称"] = "货品1";
            dr["类型"] = "洒";
            dr["价格"] = "100";
            dr["数量"] = "1";
            dr["金额"] = "100";
            dr["免费"] = false;

            result.Rows.Add(dr);


            DataRow dr1 = result.NewRow();
            dr1["货品条码"] = "000002";
            dr1["货品名称"] = "货品2";
            dr1["类型"] = "货品";
            dr1["价格"] = "200";
            dr1["数量"] = "1";
            dr1["金额"] = "200";
            dr1["免费"] = true;
            result.Rows.Add(dr1);
            return result;
        }


        public DataTable BindList1()
        {
            var result = new DataTable();
            result.Columns.Add("货品条码", typeof(string)); //产品名称
            result.Columns.Add("货品名称", typeof(string)); //单位
            result.Columns.Add("类型", typeof(string)); //单价
            result.Columns.Add("价格", typeof(string)); //数量
            result.Columns.Add("数量", typeof(string)); //单价
            result.Columns.Add("金额", typeof(string)); //数量
            result.Columns.Add("销售性质", typeof(string)); //数量

            result.Columns.Add("消费时间", typeof(string)); //数量




            //给该列填值
            DataRow dr = result.NewRow();
            dr["货品条码"] = "000003";
            dr["货品名称"] = "货品3";
            dr["类型"] = "洒";
            dr["价格"] = "100";
            dr["数量"] = "1";
            dr["金额"] = "100";
            dr["销售性质"] = "免费";
            dr["消费时间"] = "2011-08-11 12:15:15";


            result.Rows.Add(dr);


            DataRow dr1 = result.NewRow();
            dr1["货品条码"] = "000004";
            dr1["货品名称"] = "货品4";
            dr1["类型"] = "货品";
            dr1["价格"] = "200";
            dr1["数量"] = "1";
            dr1["销售性质"] = "消费";
            dr1["金额"] = "200";

            dr["消费时间"] = "2011-08-11 12:15:16";

            result.Rows.Add(dr1);
            return result;
        }

    }
}
